<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0,maximum-scale=1.0"/>
    <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
    <link rel="stylesheet" type="text/css" href="css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <title>扫码点餐—订单确认</title>

</head>
<body>
<div id="pay">
    <div class="menu_header">
        <span class="current_num">当前桌号:<span class="znum"></span></span>
        <span class="people_num">
				人数:<span class="pnum"></span>人
				<i class="m_bj"></i>
			</span>
    </div>
    <div class="payCon">
        <div class="content">
            <span class="consume">消费金额: ¥ <i class="totalPrice"></i>.00</span>
            <span class="payTime">
					<!--下单时间:<i class="timestamp"></i>-->
					
				</span>
            <span class="discount">优惠金额: ¥ <i class="minus_price"></i></span>
            <span class="payable">需支付: ¥<i class="actualPrice"></i>.00</span>
        </div>
    </div>
    <div class="payList">
        <h2 class="listTitle">支付方式</h2>
        <ul class="listCon">
            <!--<li class="list" class="active" onclick="changeCheck()">
                <img class="listImg" src=""/>
                <span class="listBalance"></span>
                <i class="check"></i>
            </li>-->
            <li class="list">
                <img class="listImg" src="images/wechat.png"/>
                <span class="listTxt">微信支付</span>
                <!--<i class="check"></i>-->
            </li>
        </ul>
        <a class="pay_btn" href="javascript:void(0);" onclick="payNow()">立即支付</a>
    </div>
    <!--<div class="float_con">
        <div class="continue" onclick="continu()">
            <i class="icon"></i>
            <span class="txt">继续点餐</span>
        </div>
        <div  class="goBackMenu" >
            <i class="icon"></i>
            <span class="txt">返回菜单</span>
        </div>
    </div>-->
    <input type="hidden" name="timestamp" id="timestamp" value=""/>
    <input type="hidden" id="order_id">
    <input type="hidden" id="order_no">
</div>
<script type="text/javascript">
    $(function () {
        (function ($) {
            $.getUrlParam = function (name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]);
                return null;
            }
        })
        (jQuery);
        $(".znum").html($.getUrlParam('znum'));
        $(".pnum").html($.getUrlParam('pnum'));
        $(".totalPrice").html($.getUrlParam('totalPrice'));
        $(".minus_price").html($.getUrlParam('minus_price'));
        $(".actualPrice").html($.getUrlParam('actualPrice'));
        $("#timestamp").val($.getUrlParam('timestamp'));
        $("#order_id").val($.getUrlParam('order_no'));
        znum = $(".znum").html();
        pnum = $(".pnum").html();

        var order_id=$("#order_id").val()
        $.ajax({
            url:url() + "index.php?s=/Api/DishesOrder/getOrderno",
            data:{'order_id':order_id},
            dataType:"json",
            type:"post",
            success:function (data) {
                $("#order_no").val(data.data.order_no);
                $(".znum").text(data.data.desk_number);
                $(".pnum").text(data.data.people_number);
                $(".totalPrice").text(data.data.order_price);
                $(".minus_price").text(data.data.discount_price);
                $(".actualPrice").text(data.data.total_price);
            }
        })
    })



    //立即付款
    function payNow() {
        var out_trade_no = $("#order_no").val();
        window.location.href = "http://mytest.bndvip.com/index.php?m=Api&c=Weixinpay&a=pay&out_trade_no=" + out_trade_no;

    }
</script>
</body>
</html>